Apsoo::Application.routes.draw do

  get "requisicao/index"
  get "requisicao/show"
  get "requisicao/new"
  get "requisicao/edit"
  get "requisicao/destroy"

  get "requisicaos_controller/index"
  get "requisicaos_controller/show"
  get "requisicaos_controller/new"
  get "requisicaos_controller/edit"
  get "requisicaos_controller/destroy"

  match 'quartos/:id/destroy' => 'quartos#destroy', :as => :destroy
  match 'reservas/new/:user_id' => 'reservas#new', :as => :new_reserva_usuario
  match 'consultas/' => 'consultas#index', :as => :consultas
  match 'consultas/taxa_ocupacao' => 'consultas#taxa_ocupacao', :as => :taxa_ocupacao
  match 'consultas/evolucao_faturamento' => 'consultas#evolucao_faturamento', :as => :evolucao_faturamento
  match 'consultas/top_servicos' => 'consultas#top_servicos', :as => :servicos_faturamento
  match 'consultas/busca_hospede' => 'consultas#busca_hospede', :as => :busca_hospede
  #match 'hospedagems/from_reserva/:reserva_id' => "hospedagems#from_reserva", :as => "from_reserva"
  

  resources :usuarios
  resources :admin, :controller => 'Usuarios'
  resources :gerente, :controller => 'Usuarios'
  resources :funcionario, :controller => 'Usuarios'
  resources :hospede, :controller => 'Usuarios'
  resources :sessions
  resources :servicos
  resources :quartos
  resources :tipo_quartos
  resources :hospedagems
  resources :reservas
  resources :requisicaos
  
  get "log_in" => "sessions#new", :as => "log_in"
  get "log_out" => "sessions#destroy", :as => "log_out"
  get "sign_up" => "usuarios#new", :as => "sign_up"
  get "criar_reserva" => "reservas#new", :as => "criar_reserva"
  get "reservas/confirmar_reserva/:reserva_id" => "reservas#confirmar_reserva", :as => "confirmar_reserva"
  get "hospedagems/from_reserva/:reserva_id" => "hospedagems#from_reserva", :as => "from_reserva"
  get "hospedagems/check_out/:hospedagem_id" => "hospedagems#check_out", :as => "check_out"
  get "servicos/add_to_hospedagem/:servico_id" => "servicos#add_to_hospedagem", :as => "add_servico_hospedagem"
  get "home/index"


  match "check_in/:id_funcionario/:id_hospede" => "hospedagems#new", :as => :check_in
  
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Sample resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Sample resource route with more complex sub-resources
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', :on => :collection
  #     end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  root :to => 'home#index'

  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.
  # match ':controller(/:action(/:id))(.:format)'
end
